//
//  ViewController.m
//  MethodSwizzleDemo
//
//  Created by czera on 2020/4/15.
//  Copyright © 2020 czera. All rights reserved.
//

#import "ViewController.h"
#import <objc/message.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor redColor];
    
//    [NSURL URLWithString:@"www.baidu.com"];
    
//    NSURL *url = objc_msgSend([NSURL class],@selector(URLWithString:),@"www.baidu.com");
//    NSLog(@"%@",url);

    //    objc_msgSend()报错Too many arguments to function call expected 0,have3
    //    Build Setting--> Apple LLVM 6.0 - Preprocessing--> Enable Strict Checking of objc_msgSend Calls  改为 NO
    
    NSURL *url2 = [NSURL URLWithString:@"www.baidu.com/中文"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url2];
    NSLog(@"%@",request);
}


@end
